﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Text.Json.Serialization;
using System.Threading.Tasks;

namespace BuddHa.Camera.Protcol.HK.Models
{
    /// <summary>
    /// 5.3.2.1.1 获取监控点预览取流
    /// </summary>
    public class MonitorPreviewModel : BaseModel
    {
        public MonitorPreviewModel() : base("/artemis/api/video/v2/cameras/previewURLs", EnumRequestMethod.Post)
        {

        }

        public class MonitorPreviewRequest
        {
            /// <summary>
            /// 摄像头唯一标识
            /// </summary>
            [JsonPropertyName("cameraIndexCode")]
            public string CameraIndexCode { get; set; }

            /// <summary>
            /// 码流类型 0:主码流 1:子码流 2:第三码流
            /// </summary>
            [JsonPropertyName("streamType")]
            public int StreamType { get; set; } = 0;

            /// <summary>
            /// 取流协议 hik rtsp trmp hls
            /// </summary>
            [JsonPropertyName("protocol")]
            public string Protocol { get; set; } = "hls";

            /// <summary>
            /// 传输协议 0 UDP 1 TCP
            /// </summary>
            [JsonPropertyName("transmode")]
            public int Transmode { get; set; } = 1;

            /// <summary>
            /// 标识扩展内容
            /// </summary>
            [JsonPropertyName("expand")]
            public string Expand { get; set; } = "transcode=1&videotype=h264";

            /// <summary>
            /// 输出码流转封装格式
            /// </summary>
            [JsonPropertyName("streamform")]
            public string Streamform { get; set; } = "ps";
        }

        public class MonitorPreviewResponse
        {
            /// <summary>
            /// 取流URL
            /// </summary>
            public string Url { get; set; }
        }
    }
}
